import * as THREE from 'three'
import img from "./earth.jpg"
// 几何图形
const geometry = new THREE.BoxGeometry(200, 100,100)
// 纹理加载器,
const textureLoader = new THREE.TextureLoader()
// 使用load()加载一个图片返回一个纹理对象
const loader = textureLoader.load(img)

// 材质
const material = new THREE.MeshLambertMaterial({
    color: 0x00ffff,
    // map:loader
})
// 移除材质的颜色属性---color 会和贴图叠加
material.color = null;
// 贴图对象可以作为材质对象的颜色纹理贴图
material.map = loader
const boxMesh = new THREE.Mesh(geometry, material)

export default boxMesh